package com.lotusfall.controller;

import com.lotusfall.service.PicUploadService;
import com.lotusfall.vo.PicUploadResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@Controller
@RequestMapping("pic/upload")
public class PicUploadController {
    @Autowired
    private PicUploadService picUploadService;

    @PostMapping
    @ResponseBody
    public PicUploadResult upload(@RequestParam("file")MultipartFile multipartFile){
        return this.picUploadService.upload(multipartFile);
    }
}
